package com.turing.post.cardmanagement.util;

import java.math.BigInteger;
import java.util.List;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

/**
 * 调拨单管理
 * 
 * @author YangShuo
 * 
 */
@Remote
@Local
public interface TransferInOutStockOrderDao {
	/**
	 * 根据TransferInOutStockOrderId主键查询
	 * 
	 * @param TransferInOutStockOrderId
	 *            调拨单ID
	 * @return TransferInOutStockOrder对象
	 */
	public TransferInOutStockOrder getTransferInOutStockOrderByTransferInOutStockOrderId(
			BigInteger TransferInOutStockOrderId);

	/**
	 * 新增调拨单
	 * 
	 * @param TransferInOutStockOrder
	 *            对象
	 */
	public void insertTransferInOutStockOrder(
			TransferInOutStockOrder TransferInOutStockOrder)
			throws PCPSApplicationException;

	/**
	 * 修改调拨单
	 * 
	 * @param TransferInOutStockOrder对象
	 */
	public void updateTransferInOutStockOrder(
			TransferInOutStockOrder TransferInOutStockOrder)
			throws PCPSApplicationException;

	/**
	 * 根据状态及sysbranch查询发出方的调拨单集合
	 * 
	 * @param sysbranch
	 *            机构号
	 * @param status
	 *            状态
	 * @return TransferInOutStockOrder对象集合
	 */
	public List<TransferInOutStockOrder> getFromTransferInOutStockOrderByTransferInOutStockOrderIDandStatus(
			String sysbranch, String status) throws PCPSApplicationException;

	/**
	 * 根据状态及sysbranch查询接收方的调拨单集合
	 * 
	 * @param sysbranch
	 *            机构号
	 * @param status
	 *            状态
	 * @return TransferInOutStockOrder对象集合
	 */
	public List<TransferInOutStockOrder> getToTransferInOutStockOrderByTransferInOutStockOrderIDandStatus(
			String sysbranch, String status) throws PCPSApplicationException;

	/**
	 * 修改CancelTransferInOutStockOrderId
	 * 
	 * @param TransferInOutStockOrderId调拨单ID
	 * @param CancelTransferInOutStockOrderId
	 *            取消调拨单ID
	 * @return 修改记录条数
	 */
	public Integer updateTransferInOutStockOrderCancelID(
			BigInteger transferInOutStockOrderId,
			BigInteger cancelTransferInOutStockOrderId)
			throws PCPSApplicationException;

	/**
	 * 查询调拨单，出库机构，入库机构，时间段，状态，页码
	 * 
	 * @param fromsysbranch
	 *            出库机构
	 * @param tosysbranch
	 *            入库机构
	 * @param starttime
	 *            开始时间
	 * @param endtime
	 *            结束时间
	 * @param TransferStatus
	 *            状态
	 * @param page
	 *            页码
	 * @return TransferInOutStockOrder对象集合
	 */
	public List<TransferInOutStockOrder> getTransferInOutStockOrderList(
			String fromsysbranch, String tosysbranch, String starttime,
			String endtime, String transferStatus, Integer page);

	/**
	 * 查询调拨单总数，出库机构，入库机构，时间段，状态，页码
	 * 
	 * @param fromsysbranch
	 *            出库机构
	 * @param tosysbranch
	 *            入库机构
	 * @param starttime
	 *            开始时间
	 * @param endtime
	 *            结束时间
	 * @param TransferStatus
	 *            状态
	 * @return 记录条数
	 */
	public Integer getTransferInOutStockOrderCount(String fromsysbranch,
			String tosysbranch, String starttime, String endtime,
			String transferStatus);

	// 查询调拨单
	public List<TransferInOutStockOrder> getTransferInOutStockOrderListByCond(PCPSWebInput webInput,
			 String tosysbranch, String starttime,
			String endtime, String transferStatus, Integer page);

	public Integer getTransferInOutStockOrderTotalByCond(PCPSWebInput webInput,
			String tosysbranch, String starttime, String endtime,
			String transferStatus);

	/**
	 * 卡-6 卡库存调拨统计表
	 * 
	 * @param webInput
	 * @param tranDate
	 * @return
	 */
	public List<Object[]> getTransferInOutStockReportByCondition(
			PCPSWebInput webInput,String fromBranchNo,String toBranchNo, String isSingle,String ssSingle,
			String startTime, String endTime,String transferStatus);

}
